using System;
using System.Collections.Generic;
using System.Linq;
using BepInEx;
using HarmonyLib;
using Assets;
using Hearthstone;
using Hearthstone.Progression;
using PegasusLettuce;
using PegasusShared;
using PegasusUtil;
using UnityEngine;

namespace Mercenary
{
    public static class UtilsTask
    {
        public static int m_globalWater = 0;
        private static List<Task> m_allTasks = new List<Task>();

        public static List<Task> GetTaskList()
        {
            return m_allTasks;
        }

        public static void DismissTask(int taskId)
        {
            VisitorTaskDbfRecord taskRecordByID =
                LettuceVillageDataUtil.GetTaskRecordByID(taskId);
            if (taskRecordByID != null)
            {
                int mercenaryVisitorId = taskRecordByID.MercenaryVisitorId;
                Network.Get().DismissMercenaryTask(mercenaryVisitorId);
            }
        }

        public static void UpdateTask()
        {
            NetCache.NetCacheMercenariesVillageVisitorInfo netObject =
                NetCache.Get().GetNetObject<NetCache.NetCacheMercenariesVillageVisitorInfo>();
            for (int i = netObject.VisitorStates.Count-1 ; i >= 0; --i)
            {
                //因为新任务是添加在第一条，所以倒序做任务，先进先做
                VisitorTaskDbfRecord taskRecordByID = LettuceVillageDataUtil.GetTaskRecordByID(
                    netObject.VisitorStates[i].ActiveTaskState.TaskId);
                MercenaryVisitorDbfRecord visitorRecordByID =
                    LettuceVillageDataUtil.GetVisitorRecordByID(taskRecordByID.MercenaryVisitorId);
                if((MercenaryVisitor.VillageVisitorType)Traverse.Create(visitorRecordByID).Field(
                    "m_visitorType").GetValue()==MercenaryVisitor.VillageVisitorType.STANDARD)
                {
                    SetTask(taskRecordByID.ID,visitorRecordByID.MercenaryId,
                        taskRecordByID.TaskTitle.GetString(true),
                        taskRecordByID.TaskDescription.GetString(true));
                }
            }
            m_allTasks = (from t in m_allTasks orderby
                t.m_priority,t.m_water select t).ToList();
        }

        public static void SetTask(int taskId,
            int mercenaryId, string title, string desc)
        {
            // 对于优先使用多个英雄配合的，优先级设为0 /1，保证一起出场
            // 对于需要6个英雄配合的，优先级为0, 3个以下的，优先级为1
            // 未满30级的佣兵 优先级设为10，放后备箱里跟着升级
            // 部分要求地图的基本优先级都是5（正常）挨个排着
            // 英雄悬赏优先度为2，为了能早日排进H1-1的地图
            UtilsLog.Log(string.Format("[TID:{0}][MID:{1}] {2} {3}",
                taskId, mercenaryId, title, desc));

            //**********施法者任务***********//
            //豪斯 任务17 
            if (title.Contains("大箭就是好箭"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-5",true,
                    ++m_globalWater,mercenaryId,title,desc));
                return;
            }
            //德雷克 任务14
            if (title.Contains("邪能的力量"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-5",false,
                    ++m_globalWater,mercenaryId,title,desc));
                return;
            }
            //古夫 任务14
            if (title.Contains("带刺的自然"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-5",false,
                    ++m_globalWater,mercenaryId,title,desc));
                return;
            }
            /*
            //塔姆辛 任务10
            if (title.Contains("证明我的价值"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-6",true,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(MercConst.伊莉斯_逐星,EquipConst.猴爪),
                    new MercCard(MercConst.玉珑,0),
                    new MercCard(mercenaryId,EquipConst.暗影符文),
                }));
                return;
            }
            //沃金 任务9 任务14
            if (title.Contains("暗影秘法") || title.Contains("沃金的意志") )
            {
                m_allTasks.Add(new Task(taskId,0,"2-6",true,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(MercConst.魔像师卡扎库斯,0),
                    new MercCard(mercenaryId,EquipConst.沃金战刃),
                }));
                return;
            }
            //神谕者摩戈尔 任务12 
            if (title.Contains("鲜血淋漓"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-6",true,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(mercenaryId,EquipConst.尖刺泡泡鱼),
                    new MercCard(MercConst.老瞎眼,EquipConst.导航员的护符),
                    new MercCard(MercConst.厨师曲奇,EquipConst.开胃前菜),
                }));
                return;
            }
            //乌瑟尔 任务12
            if (title.Contains("光明使者"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-5",true,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(mercenaryId,EquipConst.微光肩甲),
                    new MercCard(MercConst.考内留斯_罗姆,EquipConst.黎明之盾),
                    new MercCard(MercConst.先知维伦,0),
                }));
                return;
            }
            //吉安娜 任务12
            if (title.Contains("千钧一发"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-6",true,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(MercConst.伊莉斯_逐星,EquipConst.猴爪),
                    new MercCard(MercConst.玉珑,0),
                    new MercCard(mercenaryId,EquipConst.寒冰屏障护身符),
                }));
                return;
            }
            //安东尼 任务
            if (title.Contains("火焰滚滚"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-5",true,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(MercConst.玉珑,0),
                    new MercCard(MercConst.赤精,EquipConst.赤精之杖),
                    new MercCard(mercenaryId,EquipConst.灼热吊坠),
                }));
                return;
            }
            //安东尼 任务
            if (title.Contains("保护肯瑞托"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-5",true,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(MercConst.拉格纳罗斯,EquipConst.炽烧符文),
                    new MercCard(mercenaryId,EquipConst.烈焰饰环),
                }));
                return;
            }
            //闪狐 任务3
            if (title.Contains("现在归我了") )
            {
                m_allTasks.Add(new Task(taskId,5,"2-5",true,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(mercenaryId,EquipConst.第十条尾巴),
                }));
                return;
            }
            //闪狐 任务
            if (title.Contains("唰！"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-5",true,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(MercConst.玉珑,0),
                    new MercCard(mercenaryId,EquipConst.法力符文),
                    new MercCard(MercConst.贝恩_血蹄,EquipConst.酋长的羽毛),
                }));
                return;
            }
            //闪狐 任务9 任务14 泰兰德 任务9
            if (desc.Contains("加快友方技能的速度值总") || desc.Contains("使一个友方技能的速度值加快"))
            {
                m_allTasks.Add(new Task(taskId,5,"2-5",true,++m_globalWater,
                    mercenaryId,title,desc,GetQuickMercenary(mercenaryId)));
                return;
            }
            //空军上将 任务2
            if (title.Contains("列队飞行"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-5",false,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(mercenaryId,0),
                }));
                return;
            }
            //珑心 任务3 任务10
            if (title.Contains("远古洞窟") || title.Contains("修习飞举"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-5",false,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(mercenaryId,EquipConst.昆莱之晶),
                }));
                return;
            }
            //奥妮克希亚 任务2
            if (title.Contains("吸气"))
            {
                m_allTasks.Add(new Task(taskId,5,"H2-6",false,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(mercenaryId,EquipConst.更深的呼吸),
                }));
                return;
            }
            //奥妮克希亚 任务10 任务16
            if (title.Contains("喷吐火焰") || title.Contains("团本首领下场"))
            {
                m_allTasks.Add(new Task(taskId,0,"2-5",false,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(MercConst.伊莉斯_逐星,EquipConst.猴爪),
                    new MercCard(MercConst.玉珑,0),
                    new MercCard(mercenaryId,0),
                }));
                return;
            }
            //德雷克塔尔 任务17
            if (title.Contains("淬霜之刃"))
            {
                m_allTasks.Add(new Task(taskId,0,"H1-2",true,++m_globalWater,
                    mercenaryId,title,desc,new MercCard[]
                {
                    new MercCard(mercenaryId,EquipConst.冰川之刃),
                    new MercCard(MercConst.凯瑞尔_罗姆,EquipConst.裁决秘典),
                    new MercCard(MercConst.魔像师卡扎库斯,EquipConst.野葡萄藤),
                }));
                return;
            }
            /*
            //瓦尔登·晨拥 任务9 
            if (title.Contains("学术道德"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0,"2-6", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.吉安娜_普罗德摩尔, "水元素", EquipConst.冰霜之尘),
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0),
                    TaskAdapter.GetMercenary(mercenaryId, "冰枪术", EquipConst.寒冰药水)

                }));
                return;
            }
            //瓦尔登·晨拥 任务10
            if (title.Contains("调节温度"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId,0, "2-6", new MercenaryEntity[]
                {
                    
                    TaskAdapter.GetMercenary(MercConst.玉珑,"玉火打击" ,0),
                    TaskAdapter.GetMercenary(MercConst.赤精,"振奋之歌", EquipConst.赤精之杖),
                    TaskAdapter.GetMercenary(mercenaryId, "冰枪术", EquipConst.霜冻之戒)
                }));
                return;
            }
            //瓦尔登·晨拥 任务12
            if (title.Contains("附加影响"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H1-2", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "冰风暴", EquipConst.寒冰药水),
                    TaskAdapter.GetMercenary(MercConst.冰雪之王洛克霍拉, null, EquipConst.刺骨寒风)
                }));
                return;
            }
            //先知维伦 任务12
            if (title.Contains("圣光扫荡一切"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-6", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "裂解之光", EquipConst.受祝福的碎片),
                    TaskAdapter.GetMercenary(MercConst.安度因_乌瑞恩, "神圣新星", EquipConst.祥和钟杵)
                }));
                return;
            }
            //先知维伦 任务17
            if (title.Contains("完美圣光"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "裂解之光", EquipConst.受祝福的碎片),
                    TaskAdapter.GetMercenary(MercConst.泽瑞拉, null, 0)
                }));
                return;
            }
            //布鲁坎 任务17
            if (title.Contains("一点点电"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.伊莉斯_逐星,"黄金猿",EquipConst.猴爪),
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0),
                    TaskAdapter.GetMercenary(mercenaryId, "陷足泥泞", EquipConst.霜木图腾)

                }));
                return;
            }
            //娜塔莉·赛琳 任务4
            if (title.Contains("圣光治愈一切"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "咒逐", 0),
                    TaskAdapter.GetMercenary(mercenaryId, "祈福", 0)
                }));
                return;
            }
            //迦顿 任务12
            if (title.Contains("烧烤弱鸡"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-6", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.厨师曲奇, "小鱼快冲", 0),
                    TaskAdapter.GetMercenary(mercenaryId, "活体炸弹",EquipConst.焚火印记),
                    TaskAdapter.GetMercenary(MercConst.安度因_乌瑞恩,"神圣新星",EquipConst.祥和钟杵),
                    
                }));
                return;
            }
            //迦顿 任务10 任务14
            if (title.Contains("侵略如火") || title.Contains("翻腾火流"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "热力迸发", 0),
                    TaskAdapter.GetMercenary(MercConst.安东尼达斯, "火球术", 0),
                    TaskAdapter.GetMercenary(MercConst.拉格纳罗斯, "熔岩冲击", 0)
                }));
                return;
            }
            */

            //**********斗士任务***********//
            //伊瑞尔
            /*
            if (title.Contains("惩戒不信之徒") || title.Contains("净化邪恶"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"光缚之怒",0),
                    TaskAdapter.GetMercenary(MercConst.玉珑,"玉火打击",0),
                    TaskAdapter.GetMercenary(MercConst.赤精,"振奋之歌",EquipConst.赤精之杖)
                }));
                return;
            }
            //拉希奥
            if (title.Contains("展开双翼") || title.Contains("黑王子之站"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"真正形态",EquipConst.黑龙鳞片),
                    TaskAdapter.GetMercenary(MercConst.玉珑,"玉火打击",0),
                    TaskAdapter.GetMercenary(MercConst.赤精,"振奋之歌",EquipConst.赤精之杖)
                }));
                return;
            }
            //滑矛领主
            if (title.Contains("丢进垃圾箱") || title.Contains("那就是垃圾"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H1-1", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"处理垃圾",EquipConst.锐利思维),
                    TaskAdapter.GetMercenary(MercConst.玉珑,"玉火打击",0),
                    TaskAdapter.GetMercenary(MercConst.厨师曲奇,"小鱼快冲",0)
                }));
                return;
            }
            //尤朵拉 任务9 任务16
            if (title.Contains("炮灰") || title.Contains("火炮齐射"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5,"H1-1", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"准备火炮",EquipConst.装填武器)

                }));
                return;
            }
            //尤朵拉 任务3 任务14
            if (title.Contains("远洋助手") || title.Contains("飓风营救"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"掩护射击",EquipConst.装填武器,-1,
                        TargetType_E.Friendly)

                }));
                return;
            }
            //雷克萨
            if (title.Contains("唯一的朋友"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"动物伙伴",EquipConst.熊妈妈之爪),
                    TaskAdapter.GetMercenary(MercConst.穆克拉,null,EquipConst.穆克拉的大表哥)

                }));
                return;
            }
            //弗丁 任务2 任务14
            if (title.Contains("王者祝福") || title.Contains("银色北伐军"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "王者祝福",
                        EquipConst.王者之盔, -1, TargetType_E.Friendly)
                }));
                return;
            }
            //斯卡布斯·刀油 任务1 任务9
            if (title.Contains("秘密探员") || title.Contains("二加二等于五"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "战术打击", EquipConst.军情七处合约),
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0)

                }));
                return;
            }
            //泰瑞尔 任务2
            if (title.Contains("巨大的谎言"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "1-10", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.巴琳达_斯通赫尔斯,null,EquipConst.次级水元素),
                    TaskAdapter.GetMercenary(MercConst.迦顿男爵,"地狱火",EquipConst.焚火印记),
                    TaskAdapter.GetMercenary(MercConst.拉格纳罗斯,"死吧，虫子",EquipConst.炽烧符文),
                    TaskAdapter.GetMercenary(MercConst.冰雪之王洛克霍拉,null,EquipConst.刺骨寒风),
                    TaskAdapter.GetMercenary(MercConst.吉安娜_普罗德摩尔,"浮冰术",EquipConst.寒冰屏障护身符),
                    TaskAdapter.GetMercenary(mercenaryId,"圣剑挺击",EquipConst.圣羽之辉)

                }));
                return;
            }
            //泰瑞尔 任务10
            if (title.Contains("黑暗流亡者"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H1-9", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.巴琳达_斯通赫尔斯,null,EquipConst.次级水元素),
                    TaskAdapter.GetMercenary(MercConst.迦顿男爵,"地狱火",EquipConst.焚火印记),
                    TaskAdapter.GetMercenary(MercConst.拉格纳罗斯,"死吧，虫子",EquipConst.炽烧符文),
                    TaskAdapter.GetMercenary(MercConst.冰雪之王洛克霍拉,null,EquipConst.刺骨寒风),
                    TaskAdapter.GetMercenary(MercConst.吉安娜_普罗德摩尔,"浮冰术",EquipConst.寒冰屏障护身符),
                    TaskAdapter.GetMercenary(mercenaryId,"圣剑挺击",EquipConst.圣羽之辉)

                }));
                return;
            }
            //泰瑞尔 任务12
            if (title.Contains("恶魔再临"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H2-6", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.巴琳达_斯通赫尔斯,null,EquipConst.次级水元素),
                    TaskAdapter.GetMercenary(MercConst.迦顿男爵,"地狱火",EquipConst.焚火印记),
                    TaskAdapter.GetMercenary(MercConst.拉格纳罗斯,"死吧，虫子",EquipConst.炽烧符文),
                    TaskAdapter.GetMercenary(MercConst.冰雪之王洛克霍拉,null,EquipConst.刺骨寒风),
                    TaskAdapter.GetMercenary(MercConst.吉安娜_普罗德摩尔,"浮冰术",EquipConst.寒冰屏障护身符),
                    TaskAdapter.GetMercenary(mercenaryId,"圣剑挺击",EquipConst.圣羽之辉)

                }));
                return;
            }
            //泰瑞尔 任务14
            if (title.Contains("夺魂之镰"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H5-2", new MercenaryEntity[]
                {

                    TaskAdapter.GetMercenary(MercConst.巴琳达_斯通赫尔斯,null,EquipConst.次级水元素),
                    TaskAdapter.GetMercenary(MercConst.迦顿男爵,"地狱火",EquipConst.焚火印记),
                    TaskAdapter.GetMercenary(MercConst.拉格纳罗斯,"死吧，虫子",EquipConst.炽烧符文),
                    TaskAdapter.GetMercenary(MercConst.冰雪之王洛克霍拉,null,EquipConst.刺骨寒风),
                    TaskAdapter.GetMercenary(MercConst.吉安娜_普罗德摩尔,"浮冰术",EquipConst.寒冰屏障护身符),
                    TaskAdapter.GetMercenary(mercenaryId,"圣剑挺击",EquipConst.圣羽之辉)

                }));
                return;
            }
            //风行者 任务 2 任务17
            if (title.Contains("重拾灵魂") || title.Contains("女妖之怒"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "重拾灵魂", EquipConst.灵魂缶),
                    TaskAdapter.GetMercenary(MercConst.魔像师卡扎库斯, "构筑魔像", EquipConst.野葡萄藤),
                    TaskAdapter.GetMercenary(MercConst.海盗帕奇斯, "眼魔船工", EquipConst.武器柜)
                }));
                return;
            }
            //风行者 任务 12
            if (title.Contains("无论死活"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "重拾灵魂", EquipConst.死亡箭雨),
                    TaskAdapter.GetMercenary(MercConst.魔像师卡扎库斯, "构筑魔像", EquipConst.野葡萄藤),
                    TaskAdapter.GetMercenary(MercConst.海盗帕奇斯, "眼魔船工", EquipConst.武器柜)
                }));
                return;
            }
            //风行者 任务3 任务9 
            if (title.Contains("瞄准叛徒") || title.Contains("如此狡诈"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0),
                    TaskAdapter.GetMercenary(mercenaryId, "为了女王", EquipConst.哀伤之剑)
                    
                }));
                return;
            }
            //老瞎眼 任务9
            if (title.Contains("鱼类学"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "2-6", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"老蓟皮",EquipConst.始生鱼人)
                }));
                return;
            }
            //老瞎眼 任务12
            if (title.Contains("鱼多势众"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"鱼人入侵",0),
                    TaskAdapter.GetMercenary(MercConst.厨师曲奇,null,0),
                    TaskAdapter.GetMercenary(MercConst.神谕者摩戈尔,null,0)
                }));
                return;
            }
            //塔维什·雷矛 任务12
            if (title.Contains("当心脚下"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-6", new MercenaryEntity[]
                {

                    TaskAdapter.GetMercenary(mercenaryId,"爆炸陷阱",EquipConst.拉线操纵),
                    TaskAdapter.GetMercenary(MercConst.瓦罗克_萨鲁法尔,"旋风斩",EquipConst.狂战士之刃),
                    TaskAdapter.GetMercenary(MercConst.伊莉斯_逐星,"黄金猿",EquipConst.猴爪),
                }));
                return;
            }
            //萨鲁法尔 任务14
            if (title.Contains("全力一击"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-6",new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"动员打击",EquipConst.萨隆踏靴),
                    TaskAdapter.GetMercenary(MercConst.洛卡拉,"进攻集结",EquipConst.激励头盔)
                }));
                return;
            }
            //拉索利安 任务1 任务12
            if (title.Contains("势均力敌") || title.Contains("无坚不摧"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "闪电军团", 0),
                    TaskAdapter.GetMercenary(MercConst.玛诺洛斯, null, 0)
                }));
                return;
            }
            //拉索利安 任务14
            if (title.Contains("战场主宰"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"巨型大恶魔",EquipConst.恶魔灰烬),
                }));
                return;
            }
            //拉索利安 任务17
            if (title.Contains("巨型邪魔"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "巨型大恶魔", EquipConst.恶魔灰烬),
                    TaskAdapter.GetMercenary(MercConst.洛卡拉, "进攻集结", EquipConst.激励头盔)
                }));
                return;
            }
            //吃手手 任务3 
            if (title.Contains("鸡肉味")||title.Contains("饥不可耐") || title.Contains("每日一鱼人"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"吞噬",EquipConst.土灵护甲),
                    TaskAdapter.GetMercenary(MercConst.老瞎眼, "老蓟皮", EquipConst.始生鱼人)
                }));
                return;
            }
            //指挥官沃恩 任务9
            if (title.Contains("燃棘必胜"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0),
                    TaskAdapter.GetMercenary(mercenaryId,"火焰吐息",0)
                }));
                return;
            }
            //指挥官沃恩 任务12 任务17
            if (title.Contains("他们想挨斧头了") || title.Contains("猛斧与盟友"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0,"2-6" , new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.伊莉斯_逐星,"黄金猿",EquipConst.猴爪),
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0),
                    TaskAdapter.GetMercenary(mercenaryId,"飞斧投掷",0)
                }));
                return;
            }
            //迪亚波罗
            if (title.Contains("死亡降临"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-6", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "火焰践踏", 0),

                    TaskAdapter.GetMercenary(MercConst.厨师曲奇, "小鱼快冲", EquipConst.开胃前菜)
                }));
                return;
            }
            //艾德温·迪菲亚首脑 任务11 任务17
            if (title.Contains("致命一击") && mercenaryId == MercConst.艾德温_迪菲亚首脑 || title.Contains("身先士卒"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H1-2", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "首脑的悬赏", EquipConst.公平分配),
                    TaskAdapter.GetMercenary(MercConst.海盗帕奇斯, null, 0),
                    TaskAdapter.GetMercenary(MercConst.尤朵拉, null, 0)
                }));
                return;
            }
            //加尔范 任务9
            if (title.Contains("贯穿伤口"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"致命打击",EquipConst.德雷克塔尔的恩惠),
                    TaskAdapter.GetMercenary(MercConst.泽瑞拉,"快速治疗",0),
                    TaskAdapter.GetMercenary(MercConst.安娜科德拉,"野兽回复",EquipConst.狂野的徽记)
                }));
                return;
            }
            //希奈斯特拉 任务2
            if (title.Contains("何必忧伤"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "法力壁垒", EquipConst.法力胸针,
                        -1, TargetType_E.Friendly)
                }));
                return;
            }
            //雪怒 任务12
            if (title.Contains("往日旧梦"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"伏虎闪雷", EquipConst.雪怒之矛),
                    TaskAdapter.GetMercenary(MercConst.凯瑞尔_罗姆,"光明圣印",EquipConst.裁决秘典),
                    TaskAdapter.GetMercenary(MercConst.穆克拉,"原始之力",EquipConst.新鲜香蕉)
                }));
                return;
            }
            //雪怒 任务16
            if (title.Contains("战斗热血"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H1-2", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"白虎飞扑", EquipConst.天神胸甲),
                    TaskAdapter.GetMercenary(MercConst.凯瑞尔_罗姆,"光明圣印",EquipConst.裁决秘典),
                    TaskAdapter.GetMercenary(MercConst.穆克拉,"原始之力",EquipConst.新鲜香蕉)
                }));
                return;
            }
            //奈法利安 任务2 
            if (title.Contains("完美的龙"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "多彩能量", EquipConst.实验对象,
                        -1, TargetType_E.Friendly)
                }));
                return;
            }
            //奈法利安 任务12 
            if (title.Contains("暗影烈焰"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "暗影烈焰", EquipConst.多彩龙军团),
                    TaskAdapter.GetMercenary(MercConst.希奈丝特拉,"暮光灭绝", 0),
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", EquipConst.玉火之矛)
                }));
                return;
            }
            //奈法利安 任务17
            if (title.Contains("还算有用"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H1-2", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"多彩能量", EquipConst.多彩龙军团),
                    TaskAdapter.GetMercenary(MercConst.凯瑞尔_罗姆,"光明圣印",EquipConst.裁决秘典),
                    TaskAdapter.GetMercenary(MercConst.魔像师卡扎库斯,"暗影之爪",EquipConst.野葡萄藤)
                }));
                return;
            }
            //暴龙王克鲁什  任务12
            if (title.Contains("暴龙之王"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-6", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"顶级捕食者", EquipConst.烈焰利爪),
                    TaskAdapter.GetMercenary(MercConst.洛卡拉,"进攻集结",EquipConst.激励头盔),
                    TaskAdapter.GetMercenary(MercConst.魔像师卡扎库斯,"暗影之爪",EquipConst.野葡萄藤)
                })); 
                return;
            }
            */

            //**********护卫任务***********//
            //玛法里奥
            /*
            if (title.Contains("自然力量"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "大德鲁伊的召唤",
                        EquipConst.石南草, 0, TargetType_E.Unspecified)
                }));
                return;
            }
            if (title.Contains("以艾萨拉之名") || title.Contains("水流之力"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"俘获之潮",EquipConst.蔑视),
                    TaskAdapter.GetMercenary(MercConst.玉珑,"玉火打击",0),
                    TaskAdapter.GetMercenary(MercConst.赤精,"振奋之歌", EquipConst.赤精之杖),
                }));
                return;
            }
            //加拉克苏斯大王 任务11 任务10
            if (title.Contains("地狱火顺劈")|| title.Contains("邪能烈焰"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0,"2-5" ,new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"加拉克苏斯之拳",EquipConst.实击护手),
                    TaskAdapter.GetMercenary(MercConst.玛诺洛斯,"恐惧嚎叫",EquipConst.深渊领主之杖),
                    TaskAdapter.GetMercenary(MercConst.拉索利安,"巨型大恶魔",EquipConst.恶魔印记)
                }));
                return;
            }
            //库尔特鲁斯·殒烬 任务10
            if (title.Contains("独自训练"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 1, "H1-2", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"屠魔者", EquipConst.恶魔卫士),
                    TaskAdapter.GetMercenary(MercConst.凯瑞尔_罗姆,"光明圣印",EquipConst.裁决秘典),
                    TaskAdapter.GetMercenary(MercConst.魔像师卡扎库斯,"暗影之爪",EquipConst.野葡萄藤)
                }));
                return;
            }
            //格罗玛什·地狱咆哮  任务10
            if (title.Contains("暂缓苦痛"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"战斗怒火", EquipConst.饮血坠饰),
                    TaskAdapter.GetMercenary(MercConst.凯瑞尔_罗姆,"光明圣印",EquipConst.裁决秘典),
                    TaskAdapter.GetMercenary(MercConst.魔像师卡扎库斯,"暗影之爪",EquipConst.野葡萄藤)
                }));
                return;
            }
            //格罗玛什·地狱咆哮  任务14
            if (title.Contains("玛诺洛斯的许诺"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H1-1", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"战斗怒火", EquipConst.饮血坠饰),
                    TaskAdapter.GetMercenary(MercConst.厨师曲奇 ,"小鱼快冲",0)
                }));
                return;
            }
            //瓦里安·乌瑞恩 任务3 任务17
            if (title.Contains("为了暴风城") || title.Contains("屹立不倒"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "反击", EquipConst.战争旗帜)
                }));
                return;
            }
            //拉格纳罗斯 任务10 
            if (title.Contains("全部烧光"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "熔岩冲击", EquipConst.熔火之心),
                    TaskAdapter.GetMercenary(MercConst.安东尼达斯, null, 0)
                }));
                return;
            }
            //阿莱克斯塔萨 任务17
            if (title.Contains("他们的力量属于我"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.伊莉斯_逐星,"黄金猿",EquipConst.猴爪),
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0),
                    TaskAdapter.GetMercenary(mercenaryId, "红龙女王的计策", EquipConst.巨龙军团护身符)
                }));
                return;
            }
            //阿莱克斯塔萨 任务12 任务14
            if (title.Contains("一举两得") || title.Contains("蹈踏火焰"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "烈焰猛击", 0),
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0)
                }));
                return;
            }
            //穆克拉 任务17
            if (title.Contains("家族纽带"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5,"H1-1", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"原始之力",EquipConst.穆克拉的大表哥)
                }));
                return;
            }
            //玛诺洛斯 任务12
            if (title.Contains("愚蠢的弱者"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"邪能抽笞",EquipConst.邪能尖刺),
                    TaskAdapter.GetMercenary(MercConst.泽瑞拉,"快速治疗",0)
                }));
                return;
            }
            //蛇 任务2
            if (title.Contains("无情抽笞"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.考内留斯_罗姆,"坚守前线",0),
                    TaskAdapter.GetMercenary(mercenaryId,"反冲",EquipConst.锋锐利爪),
                    TaskAdapter.GetMercenary(MercConst.凯瑞尔_罗姆,"嘲讽",0)
                }));
                return;
            }
            //巫妖王 任务9
            if (title.Contains("你们都将臣服"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "凋零缠绕",
                        EquipConst.虚空之踏, -1, TargetType_E.Friendly)
                }));
                return;
            }
            //梵妮莎 任务9
            if (title.Contains("夺刀斩将"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0,"H1-1" ,new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "剽窃轰击", 0),
                    TaskAdapter.GetMercenary(MercConst.提里奥_弗丁,"谦逊制裁",0),
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0)
                }));
                return;
            }
            //梵妮莎 任务14
            if (title.Contains("一刃双雕"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    
                    TaskAdapter.GetMercenary(MercConst.厨师曲奇,"小鱼快冲",2),
                    TaskAdapter.GetMercenary(mercenaryId, "临时武器", EquipConst.加装口袋),
                    TaskAdapter.GetMercenary(MercConst.瓦罗克_萨鲁法尔, "旋风斩", EquipConst.狂战士之刃)
                }));
                return;
            }
            //斯尼德 任务9
            if (title.Contains("手脚并用"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H1-1", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "缴械", 0),
                    TaskAdapter.GetMercenary(MercConst.提里奥_弗丁,"谦逊制裁",0),
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0)
                }));
                return;
            }
            //斯尼德 任务12 任务14
            if (title.Contains("一刀两断") || title.Contains("乌合之众"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "嗞拉", EquipConst.加装锯刃)
                }));
                return;
            }
            //重拳先生 任务14
            if (title.Contains("铁脚无情"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-6", new MercenaryEntity[]
                {

                    TaskAdapter.GetMercenary(MercConst.洛卡拉, "进攻集结", EquipConst.激励头盔),
                    TaskAdapter.GetMercenary(mercenaryId, "落水追击", 0),
                    TaskAdapter.GetMercenary(MercConst.海盗帕奇斯, "眼魔船长", EquipConst.武器柜)
                }));
                return;
            }
            //雪王 任务12
            if (title.Contains("雪球滚滚"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.伊莉斯_逐星,"黄金猿",EquipConst.猴爪),
                    TaskAdapter.GetMercenary(MercConst.玉珑, "玉火打击", 0),
                    TaskAdapter.GetMercenary(mercenaryId, "雪球", EquipConst.冰雪之王的遮蔽)
                }));
                return;
            }
            //玉珑 任务12
            if (title.Contains("成长与新生"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "2-6", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, "青玉劲风", 0),
                }));
                return;
            }
            //范达尔·雷矛 任务17 
            if (title.Contains("拼尽全力"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H1-2", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"向前推进", EquipConst.无法撼动之物),
                    TaskAdapter.GetMercenary(MercConst.凯瑞尔_罗姆,"光明圣印",EquipConst.裁决秘典),
                    TaskAdapter.GetMercenary(MercConst.魔像师卡扎库斯,"暗影之爪",EquipConst.野葡萄藤)
                }));
                return;
            }
            //考内留斯
            if (title.Contains("我来承受伤害") || title.Contains("进攻与收获") )
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H1-2", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.玉珑,"玉火打击",0),
                    TaskAdapter.GetMercenary(mercenaryId,"坚守前线", EquipConst.启迪环带),
                    TaskAdapter.GetMercenary(MercConst.布鲁坎,"闪电箭",0,-1,TargetType_E.Friendly)
                }));
                return;
            }
            //玛诺洛斯
            if (title.Contains("让他们学会畏惧") )
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, "2-6", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId,"恐惧嚎叫", EquipConst.邪能魔肺)
                }));
                return;
            }
            */

            //--------------------------------------------------------------------------------//
            //--------------------------------通用任务----------------------------------------//
            //--------------------------------------------------------------------------------//
            //回复生命类任务
            //赛琳 任务17  维伦 任务14 光明之翼 任务17 任务11 希奈斯特拉 任务12
            /*
            if (title.Contains("平衡倾斜") || title.Contains("纯净圣光") ||
                title.Contains("治疗朋友") || title.Contains("我们交朋友吧") ||
                title.Contains("低语显现") || title.Contains("包扎伤口") ||
                title.Contains("生命守护者")|| title.Contains("耐心取胜"))
            {

                tasks.Add(TaskAdapter.GetTask(taskId, 0, "H2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.光明之翼,"妖精之尘", EquipConst.妖精口袋),
                    TaskAdapter.GetMercenary(MercConst.赤精,"振奋之歌", EquipConst.赤精之杖),
                    TaskAdapter.GetMercenary(MercConst.泽瑞拉,"快速治疗",
                        EquipConst.强光魔杖,-1,TargetType_E.Friendly)
                }));
                return;
            }
            //杀恶魔
            if (desc.Contains("击败") && desc.Contains("个恶魔"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "2-6", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            //杀龙
            if ((desc.Contains("击败")|| desc.Contains("消灭") )&& desc.Contains("条龙"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "4-1", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            //杀野兽
            if (desc.Contains("击败") && desc.Contains("只野兽"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "H1-1", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            //杀鱼人
            if (desc.Contains("消灭") && desc.Contains("鱼人"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "7-1", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            //杀元素
            if (desc.Contains("击败") && desc.Contains("元素"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 5, "H1-2", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            //巨魔造成伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("使用巨魔造成"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0),
                    TaskAdapter.GetMercenary(MercConst.沃金, "暗影涌动", EquipConst.沃金战刃)
                }));
                return;
            }
            //海盗造成伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("使用海盗造成"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0),
                    TaskAdapter.GetMercenary(MercConst.海盗帕奇斯, "眼魔船长", EquipConst.勾住船员)
                }));
                return;
            }
            //恶魔造成伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("使用恶魔造成"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0),
                    TaskAdapter.GetMercenary(MercConst.拉索利安, "巨型大恶魔", EquipConst.恶魔灰烬)
                }));
                return;
            }
            //野兽造成伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("使用野兽造成"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0),
                    TaskAdapter.GetMercenary(MercConst.闪狐, null, 0)
                }));
                return;
            }
            //元素造成伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("使用元素造成"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0),
                    TaskAdapter.GetMercenary(MercConst.冰雪之王洛克霍拉, null, 0)
                }));
                return;
            }
            //龙造成伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("使用龙造成"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0),
                    TaskAdapter.GetMercenary(MercConst.奈法利安,"龙人突袭",EquipConst.多彩龙军团)

                }));
                return;
            }
            //人类造成伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("使用人类造成"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0),
                    TaskAdapter.GetMercenary(MercConst.安东尼达斯,"烈焰风暴",EquipConst.烈焰饰环)

                }));
                return;
            }
            //造成神圣伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("神圣伤害"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0),
                    TaskAdapter.GetMercenary(MercConst.泽瑞拉, null, 0)
                }));
                return;
            }
            //造成冰霜伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("冰霜伤害"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0),
                    TaskAdapter.GetMercenary(MercConst.冰雪之王洛克霍拉,"冰雹", EquipConst.刺骨寒风)
                }));
                return;
            }
            //造成火焰伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("火焰伤害"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.拉格纳罗斯, "死吧，虫子", EquipConst.炽烧符文),
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            //造成暗影伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("暗影伤害"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.沃金, "虚弱诅咒", 0),
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            //造成邪能伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("邪能伤害"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.玛诺洛斯, null, 0),
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            //造成自然伤害
            if (desc.Contains("使用包含此佣兵的队伍") && desc.Contains("自然伤害"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 0, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(MercConst.布鲁坎, "闪电箭", EquipConst.雷鸣系带),
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            //英雄难度相关
            if (desc.Contains("英雄难度"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 1, "H1-1", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            if (desc.Contains("完成") && desc.Contains("个悬赏"))
            {
                LettuceMercenary mercenary = UtilsMerc.GetMercenary(mercenaryId);
                if (desc.Contains("30级时") && !mercenary.IsMaxLevel())
                {
                    tasks.Add(TaskAdapter.GetTask(taskId, 10, new MercenaryEntity[]
                    {
                        TaskAdapter.GetMercenary(mercenaryId, null, 0)
                    }));
                }
                else
                {
                    tasks.Add(TaskAdapter.GetTask(taskId, 5, "H1-1", new MercenaryEntity[]
                    {
                        TaskAdapter.GetMercenary(mercenaryId, null, 0)
                    }));
                }
                return;
            }
            //赐福
            if (desc.Contains("利用赐福"))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, 10, "2-5", new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            */

            /*
            int num = desc.IndexOf("$ability(", StringComparison.Ordinal);
            if (num == -1)
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            int num2 = num + "$ability(".Length;
            int num3 = desc.IndexOf(")", num2, StringComparison.Ordinal);
            if (num3 == -1)
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            string[] array = desc.Substring(num2, num3 - num2).Split(new char[]
            {
                ','
            });
            int num4;
            int num5;
            if (!int.TryParse(array[0], out num4) || !int.TryParse(array[1], out num5))
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            LettuceMercenaryDbfRecord record = GameDbf.LettuceMercenary.GetRecord(mercenaryId);
            if (num4 >= record.LettuceMercenarySpecializations.Count)
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            LettuceMercenarySpecializationDbfRecord lettuceMercenarySpecializationDbfRecord =
                record.LettuceMercenarySpecializations[num4];
            if (num5 >= lettuceMercenarySpecializationDbfRecord.LettuceMercenaryAbilities.Count)
            {
                tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
                {
                    TaskAdapter.GetMercenary(mercenaryId, null, 0)
                }));
                return;
            }
            int lettuceAbilityId = lettuceMercenarySpecializationDbfRecord.LettuceMercenaryAbilities[num5].LettuceAbilityId;
            LettuceAbilityDbfRecord record2 = GameDbf.LettuceAbility.GetRecord(lettuceAbilityId);
            tasks.Add(TaskAdapter.GetTask(taskId, new MercenaryEntity[]
            {
                TaskAdapter.GetMercenary(mercenaryId, record2.AbilityName,
                    GetEquipEnHanceSkill(record2.AbilityName))
            }));
            */
            m_allTasks.Add(new Task(taskId,5,"2-5",false,
                ++m_globalWater,mercenaryId,title,desc));
            return;
        }
    }
}
